import axios from 'axios';

const baseURL = 'http://localhost:5173';

const request = axios.create({
  baseURL,
  timeout: 5000,
});

request.interceptors.request.use(
  config => {
    return config;
  },
  err => {
    return Promise.reject(err);
  }
);

request.interceptors.response.use(
  res => {
    return res.data;
  },
  err => {
    return Promise.reject(err);
  }
);

export default request;
